import { useAuth } from "@/app/context/AuthContext";
import { createHomeStyles } from "@/assets/styles/home.styles";
import useTheme from "@/hooks/useTheme";
import { Ionicons } from "@expo/vector-icons";
import { LinearGradient } from "expo-linear-gradient";
import { Text, View } from "react-native";

export default function Header() {
    const { colors } = useTheme();
    const homeStyles = createHomeStyles(colors);
    const { user, logout } = useAuth();

    return (
        <View style={homeStyles.header}>
            <View style={homeStyles.titleContainer}>
                <LinearGradient colors={colors.gradients.primary} style={homeStyles.iconContainer}>
                    <Ionicons name="flash-outline" size={28} color="#fff" />
                </LinearGradient>
                <View style={homeStyles.titleTextContainer}>
                    <Text style={homeStyles.title}>Welcome Back {user?.name}</Text>
                </View>
            </View>
        </View>
    )
}